`:top
The `!.NET Persistence API`!, also referred to as `!NPA`!, is a persistence and `F33f`_`[object–relational mapping`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Object–relational_mapping]`_`f (ORM) specification for the `F33f`_`[.NET framework`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=.NET_Framework]`_`f.`:cite-ref-1[`F5bf`_`[1`#cite-note-1]`_`f]
NPA is based on the `F33f`_`[Java Persistence API`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Java_Persistence_API]`_`f (JPA), which is the standard persistence API in the `F33f`_`[Java`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Java_(programming_language)]`_`f world. NPA follows JPA by providing a complete persistence API and a rich set of ORM features.`:cite-ref-autogenerated1-2-0[`F5bf`_`[2`#cite-note-autogenerated1-2]`_`f]`:cite-ref-3[`F5bf`_`[3`#cite-note-3]`_`f]
>>Contents
• `F0af`_`[Motivation`#motivation]`_`f
• `F0af`_`[Technology`#technology]`_`f
• `F0af`_`[Implementations`#implementations]`_`f
• `F0af`_`[References`#references]`_`f
• `F0af`_`[External links`#external-links]`_`f
-─
>>Motivation
The main purposes of the .NET Persistence API (NPA) are:`:cite-ref-autogenerated1-2-1[`F5bf`_`[2`#cite-note-autogenerated1-2]`_`f]
• To provide a vendor-free persistence API for .NET, making switching from one persistence provider to another easier (avoiding `F33f`_`[vendor lock-in`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Vendor_lock-in]`_`f).
• To provide a cross-language persistence API by extending the popular `F33f`_`[Java Persistence API (JPA)`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Java_Persistence_API]`_`f to all the .NET programming languages.
>>Technology
The main features of NPA include:`:cite-ref-4[`F5bf`_`[4`#cite-note-4]`_`f]`:cite-ref-5[`F5bf`_`[5`#cite-note-5]`_`f]
• Object-oriented API for working against databases (usually RDBMS).
• Query language, based on SQL, for retrieving data from the database in an object oriented manner.
• Support of persisting `F33f`_`[POCO (plain old CLR objects)`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Plain_Old_CLR_Object]`_`f objects (entities).
• Two methods for marking classes as entity classes and for specifying other settings:
• Using attributes – meta data is embedded in class definitions in the source code.
• Using external XML – meta data is specified in external `F33f`_`[XML`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=XML]`_`f resource files.
>>Implementations
NPA is a persistence specification. To use NPA an implementation of the specification is required. Persistence and ORM vendors can provide their own implementations of NPA.
First implementation, NPA for `F33f`_`[NHibernate`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=NHibernate]`_`f, was released in December 2011.`:cite-ref-6[`F5bf`_`[6`#cite-note-6]`_`f]`:cite-ref-7[`F5bf`_`[7`#cite-note-7]`_`f]
>>References
`:cite-note-1`!1.`! `F0af`_`[↑`#cite-ref-1]`_`f NPersistence | JPA for the .NET platform
`:cite-note-autogenerated1-2`!2.`! `F0af`_`[↑`#cite-ref-autogenerated1-2-0]`_`f "FAQ | NPersistence". Archived from the original on 2012-04-26. Retrieved 2018-08-24.
`:cite-note-3`!3.`! `F0af`_`[↑`#cite-ref-3]`_`f c# – What is the equivalent of JPA in .NET? – Stack Overflow
`:cite-note-4`!4.`! `F0af`_`[↑`#cite-ref-4]`_`f "API Reference". Archived from the original on 2012-04-26. Retrieved 2018-08-24.
`:cite-note-5`!5.`! `F0af`_`[↑`#cite-ref-5]`_`f NPersistence – NuGet Must Haves
`:cite-note-6`!6.`! `F0af`_`[↑`#cite-ref-6]`_`f "NPA for NHibernate". Archived from the original on 2012-04-26. Retrieved 2011-12-30.
`:cite-note-7`!7.`! `F0af`_`[↑`#cite-ref-7]`_`f What is the equivalent of Java Persistence API for .NET? – AnandTech Forums
>>External links
Wikibooks has a book on the topic of:
.NET Development Foundation
• Official website
`c`F0af`_`[↑ Back to top`#top]`_`f`a